package de.tudarmstadt.ukp.muip.fibqdojo.visitor;

import de.tudarmstadt.ukp.muip.fibqdojo.Sentence;
import de.tudarmstadt.ukp.muip.fibqdojo.SentenceToken;
import de.tudarmstadt.ukp.muip.fibqdojo.Token;
import de.tudarmstadt.ukp.muip.fibqdojo.interfaces.IStructureVisitor;
import de.tudarmstadt.ukp.muip.fibqdojo.japanese.JapaneseToken;

public class SetPartOfSpeechVisitor implements IStructureVisitor {

    private final String partOfSpeech;

    public SetPartOfSpeechVisitor(String partOfSpeech) {
        this.partOfSpeech = partOfSpeech;
    }

    @Override
    public void visit(JapaneseToken token) {
        throw new UnsupportedOperationException(
                "SetPartOfSpeechVisitor is not implemented for a JapaneseToken (not needed yet)");
    }

    @Override
    public void visit(Token token) {
        token.setPartOfSpeech(partOfSpeech);
    }

    @Override
    public void visit(SentenceToken token) {
        token.getToken().accept(this);
    }

    @Override
    public void visit(Sentence sentence) {
    }

}
